/*
 Created by Moonbreeze on 2015/12/17.

 this class represents the Java Class info we load in memory
 when begin this JVM
 we load classes from file in this class and store them in a map
 */

#ifndef CUSTOMJVM_CLASSHEAP_H
#define CUSTOMJVM_CLASSHEAP_H
#include <map>
#include <string>
class JavaClass;
class FilePathManager;

class ClassHeap{
private:
	/*
	the map collection we use to store the class 
	and use the name as key
	*/
    std::map<std::string,JavaClass*> m_ClassMap;
	/*
	we just use this class to transform java package name to a filePath
	like java.lang.String -> java/lang/String
	*/
    FilePathManager* pFilePathManager;
public:
    ClassHeap(void);
    virtual ~ClassHeap();

    bool AddClass(JavaClass* pJavaClass);
    JavaClass* GetClass(std::string strClassName);
    bool LoadClass(std::string strClassName,JavaClass* pClass);
};

#endif //CUSTOMJVM_CLASSHEAP_H
